﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FXnaInfrastructure
{

    [Serializable]
    public class GeoLong:GeoLongLatBase
    {


        public override double Value
        {
            get
            {
                return base.Value;
            }
            set
            {
                if (this._value!=value)
                {

                    if (value > 180 || value < -180)
                    {
                        return;

                    }


                    this._value = value;

                 


                }

              


            }
        }


        //public override int Degree
        //{
        //    get
        //    {
        //        return base.Degree;
        //    }
        //    set
        //    {
        //        if (_degree != value)
        //        {
        //            if (value > 180 || value < -180)
        //            {

        //                return;
        //            }


        //            _degree = value;


        //            this.OnPropertyChanged("Degree");

        //            this.OnPropertyChanged("Value");



        //        }

        //    }
        //}

        bool _isEast = true;

        public bool IsEast
        {
            get { return _isEast; }
            set { _isEast = value; }
        }



        public override string GetValueWithString()
        {

            string str = "";

            if (this._isEast)
            {
                str = "E";

            }
            else
            {
                str = "W";
            }

            return this.Value.ToString() + str;



        }



        public override void SetValueWithString(string str)
        {
            base.SetValueWithString(str);

            if (str.EndsWith("E"))
            {
                this._isEast = true;


            }

            if (str.EndsWith("W"))
            {

                this._isEast = false;

            }
        }

    }
}
